﻿#if NET45
using System.ComponentModel;
using System.Configuration;

namespace Longbow.Configuration
{
    /// <summary>
    /// ILgbConfigurationElement 配置项实现类
    /// </summary>
    public class LgbConfigurationElement : ConfigurationElement, ILgbConfigurationElement
    {
        #region ILgbConfigurationElement Members
        /// <summary>
        /// 获得/设置 是否启用 默认 true
        /// </summary>
        [ConfigurationProperty("enabled"), DefaultValue(true)]
        public bool Enabled
        {
            get { return (bool)this["enabled"]; }
            set { this["enabled"] = value; }
        }

        /// <summary>
        /// 获得/设置 配置项键值 key
        /// </summary>
        [ConfigurationProperty("key", IsKey = true, IsRequired = true)]
        public virtual string Key
        {
            get { return (string)this["key"]; }
            set { this["key"] = value; }
        }
        #endregion
    }
}
#endif
